<#import "/common/taglibs/spring.ftl" as spring/>
<#macro tableHeaderButtons resourceIdentity='' buttons=['add','edit','delete'] addButtonType="add" updateButtonType="update" deleteButtonType="delete" functionButtons=['print','copy','pdf','excel','csv','colvis','reload','fullscreen','collapse']>
<div class="table-actions-wrapper btn-group d-none">
    <#if buttons?seq_contains('add')>
        <@security.authorize access="hasAuthority('${resourceIdentity!}:create')">
            <button class="btn btn-sm btn-brand m-btn m-btn--icon" data-type="${addButtonType}"><i class="la la-plus"></i> <@spring.message code="button.add" /></button>
        </@security.authorize>
    </#if>
    <#if buttons?seq_contains('edit')>
        <@security.authorize access="hasAuthority('${resourceIdentity!}:update')">
            <button class="btn btn-sm btn-accent m-btn m-btn--icon" data-type="${updateButtonType}"><i class="la la-edit"></i> <@spring.message code="button.edit" /></button>
        </@security.authorize>
    </#if>
    <#if buttons?seq_contains('delete')>
        <@security.authorize access="hasAuthority('${resourceIdentity!}:delete')">
            <button class="btn btn-sm btn-danger m-btn m-btn--icon" data-type="${deleteButtonType}"><i class="la la-remove"></i> <@spring.message code="button.delete" /></button>
        </@security.authorize>
    </#if>
    <#nested>
    <#if functionButtons?seq_contains('reload')>
    <button class="btn btn-sm btn-secondary m-btn m-btn--icon" data-type="reload"><i class="la la-refresh"></i></button>
    </#if>
    <#if functionButtons?seq_contains('colvis')>
    <button class="btn btn-sm btn-secondary m-btn m-btn--icon" data-type="colvis"><i class="la la-columns"></i></button>
    </#if>
    <div class="btn-group" role="group">
        <button type="button" class="btn btn-sm btn-secondary dropdown-toggle" data-toggle="dropdown">
            <@spring.message code="button.more" />
        </button>
        <div class="dropdown-menu btn-group-more">
            <#if functionButtons??>
                <#if functionButtons?seq_contains('copy')>
                    <button class="dropdown-item" type="button" data-type="copy" ><i class="la la-copy"></i> <@spring.message code="button.copy"/></button>
                </#if>
                <#if functionButtons?seq_contains('print')>
                    <button class="dropdown-item" type="button" data-type="print"><i class="la la-print"></i> <@spring.message code="button.print"/></button>
                </#if>
                <#if functionButtons?seq_contains('excel')>
                    <button class="dropdown-item" type="button" data-type="excel" ><i class="la la-file-excel-o"></i> <@spring.message code="button.export"/><@spring.message code="button.excel"/></button>
                </#if>
                <#if functionButtons?seq_contains('csv')>
                    <button class="dropdown-item" type="button" data-type="csv" ><i class="la la-file-archive-o"></i> <@spring.message code="button.export"/><@spring.message code="button.csv"/></button>
                </#if>
                <#if functionButtons?seq_contains('pdf')>
                    <button class="dropdown-item" type="button" data-type="pdf" ><i class="la la-file-pdf-o"></i> <@spring.message code="button.export"/><@spring.message code="button.pdf"/></button>
                </#if>
            </#if>
        </div>
    </div>
    <span></span>
</div>

    <#--<#if functionButtons?seq_contains('fullscreen')>
    <a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;" > </a>
    </#if>
    <#if functionButtons?seq_contains('collapse')>
    <a class="btn btn-circle btn-icon-only btn-default btn-collapse" href="javascript:;">
        <i class="fa fa-angle-up"></i>
    </a>
    </#if>-->

</#macro>